package com.ryh.constant;

/**
 * 权限类型
 * @author rao
 */

public enum PermissionEnum {
    /**
     * select:查询权限
     */
    SELECT("select"),
    /**
     * delete:删除权限
     */
    DELETE("delete"),
    /**
     * insert:添加权限
     */
    INSERT("insert"),
    /**
     * update:更新权限
     */
    UPDATE("update");

    String prmission;

    PermissionEnum(String prmission) {
        this.prmission = prmission;
    }

    public void setPrmission(String prmission) {
        this.prmission = prmission;
    }

    public String getPrmission() {
        return prmission;
    }

    public static String value(String value) {

        if ("".equals(value) || value == null) {
            return "";
        } else {
            for (PermissionEnum pe : PermissionEnum.values()) {
                if (pe.getPrmission() == value) {
                    return pe.getPrmission();
                }
            }
            return "";
        }
    }
}
